<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>application对象实例</title>
</head>
<body>
<%=application.getInitParameter("url") %>
<br/>
<%    
	Object number = application.getAttribute("count");
	int num = 0;
	if(number == null)
	{
		application.setAttribute("count",1);
		num=1;
	}
	else
	{
		num = (Integer)number;
		num++;
		application.setAttribute("count",num);
	}	
	out.print("当前访问本页面的次数为：" + num);	
%>
<br>
以下是application对象信息<br>
------------------------------------------------------
<br>
支持Servlet API主版本号：<%=application.getMajorVersion() %><br>
支持Servlet API次版本号：<%=application.getMinorVersion() %><br>
Web应用的实际路径：<%=application.getRealPath("/") %><br>
Web服务器的版本信息：<%=application.getServerInfo() %><br>
Web应用的名称为：<%=application.getServletContextName() %><br>
</body>
</html>
